package com.ming.dancing.springboot.Dao;


import com.ming.dancing.springboot.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface UserDao extends JpaRepository<User,Integer>{
    //自定义sql，登陆方法
    @Query(name = "admin",nativeQuery = true,value =
            "select * from admin where username=:username and userpassword=:userpassword ")
    User login(@Param("username") String username, @Param("userpassword") String userpassword);


}
